1. Field of the Invention
The present invention relates to technology for transmission/reception of multimedia data based on a packet network, and more particularly to a method for depacketization of multimedia packet data.
2. Description of the Related Art
Currently, a download-type transmission scheme and a stream-type transmission scheme are used to transmit image (i.e., video) and voice (i.e., audio) data in a packet network, such as the Internet. According to the download-type transmission scheme, a terminal must first accumulate an image file as it is transmitted from a server, and the terminal reproduces data of the file after transmission of the file has been completed. When a file is transmitted in such a download-type transmission scheme, a terminal cannot produce data of the file until transmission of the file has been completed. Therefore, the download-type transmission scheme is unsuitable to be used for long duration transmission for reproduction of image data or the like.
However, the stream-type transmission scheme enables a terminal to reproduce received data, even while data is being transmitted from a streaming server to the terminal. Such a stream-type transmission scheme is performed by mainly using a real-time transport protocol (RTP) (1997) such as that stipulated in request for comment (RFC) 1889 of the Internet Engineering Task Force (IETF).
FIG. 1 is a block diagram illustrating a conventional transmission procedure of multimedia packet data using a stream-type transmission scheme based on a packet network. First, a multimedia data generation unit 102 of a transmitting section 10 compresses image data acquired through an external camera and/or voice data acquired through a microphone, by using various coders. Such a compression operation generates a compressed bitstream. A packetization unit 104 performs a packetization task to match the bitstream, which has been generated by the multimedia data generation unit 102, to at least one sequentially numbered packet in order to transmit the bitstream as a sequence of the at least one sequentially numbered packet through a channel. A packet transmission unit 106 transmits the at least one sequentially numbered packet, which has been generated by the packetization unit 104, through the channel by using a protocol such as user datagram protocol/Internet protocol (UDP/IP).
A packet reception unit 126 of a receiving section 12 parses UDP/IP data received through the channel, and outputs a packet obtained through the parsing to a depacketization unit 124. The depacketization unit 124 performs a process that is the inverse of the packetization process performed by the packetization unit 104 of the transmitting section 10. That is, the depacketization unit 124 functions to extract one meaningful bitstream by accumulating parts of the bitstream from a plurality of received sequentially numbered packets. A multimedia data processing unit 122 functions to reproduce various multimedia data from the accumulated parts of the bitstream, which have been extracted by the depacketization unit 124, by using video/audio decoders.
FIG. 2 is a detailed flowchart illustrating a conventional depacketization operation of the depacketization unit 124. First, terms used in the flowchart of FIG. 2 are defined as follows. “BITSTREAM_COMPLETED” indicates task completion, “BITSTREAM_TRUNCATED”, “ATTACH_TO_BUF”, and “FLUSH_BUF”, which are referred to as “notify reason”, are used to notify an upper layer of a result of a depacketization process. The term “ATTACH_TO_BUF” is an instruction to attach a current packet to a buffer because the current packet has completed accumulation of a bitstream. The term “BITSTREAM_COMPLETED” indiates that a current packet has completed accumulation of one meaningful bitstream. The term “FLUSH_BUF” is an instruction to empty a current buffer because it is impossible to configure a current bitstream due to an error or another reason. The term “BITSTREAM_TRUNCATED” indicates that only the bitstream information accumulated up to the current time is meaningful and information after “BITSTREAM_TRUNCATED” has been lost due to error.
In addition, terms indicating each state are defined as follows. Term “prev_error” indicates that an error has occurred in a bitstream. Term “first_error” indicates that a first packet of a bitstream has been lost. Term “prev_bs_end” indicates that a previous packet has completed the accumulation of one bitstream. Term “cur_bs_end” indicates that a current packet corresponds to an end of a bitstream. Term “prev_seq” indicates the sequence number of a previous packet. Term “cur_seq” indicates the sequence number of a current packet.
The depacketization operation is now described in detail with reference to FIG. 2. When a current packet is input, first, it is determined if a previous packet has completed accumulation of a bitstream (step 402). When the previous packet has not completed the accumulation of the bitstream, it is determined if a first packet of the bitstream has been lost (step 404). When the first packet of the bitstream has not been lost, it is determined if an error has occurred in the bitstream (step 406). When an error has not occurred in the bitstream, it is determined if a value obtained by adding one to the sequence number of the previous packet is identical to the sequence number of the current packet (step 408). When the value obtained by adding one to the sequence number of the previous packet is identical to the sequence number of the current packet, it is reported to an upper layer through an “F” block process (step 490) that the current packet has completed the accumulation of one meaningful bitstream.
In the “F” block process (step 490), it is determined if the current packet is an end packet of the bitstream (step 492). Then, when the current packet is not the end packet of the bitstream, it is displayed that the previous packet has not completed accumulation of packets into the bitstream (step 494), it is reported to an upper layer that it is necessary to attach the current packet to a buffer because the current packet has not completed accumulation of the bitstream, the procedure returns to an initial step to receive a next packet, and the above-described steps are repeated. By contrast, when it is determined in step 492 that the current packet is the end packet of the bitstream currently being accumulated, it is displayed that the previous packet has completed accumulation of the bitstream, that an error has not occurred in the bitstream, and that the first packet has not been lost (step 496), the corresponding process ends, and then a succeeding process is performed.
Through such a procedure, it is possible to perform a depacketization process for all packets with only the above-described steps when there is no packet loss.
However, if it is determined that the previous packet has completed the accumulation of the bitstream when the current packet is input (step 402), it is determined if a value obtained by adding one to the sequence number of the previous packet is identical to the sequence number of the current packet (step 410). When the value obtained by adding one to the sequence number of the previous packet is identical to the sequence number of the current packet, it is reported to the upper layer through the “F” block process (step 490) that the current packet has completed accumulation of packets into one meaningful bitstream. By contrast, when it is determined in step 410 that the value obtained by adding one to the sequence number of the previous packet is not identical to the sequence number of the current packet, it is displayed that an error has occurred in the first packet (step 412), and it is reported to an upper layer through the “F” block process (step 490) that it is impossible to configure the current bitstream due to error or another reason and so it is necessary to empty a current buffer.
Meanwhile, if it is determined that the previous packet has not completed accumulation of packets into one bitstream when the current packet is input (step 402) and that the first packet has been lost (step 404), it is reported to the upper layer through the “F” block process (step 490) that it is necessary to empty the current buffer.
Also, if it is determined that the previous packet has not completed accumulation of packets into a bitstream when the current packet is input (step 402), that the first packet has not been lost (step 404), and that an error has occurred in the accumulation of the bitstream (step 406), it is reported to the upper layer through the “F” block process (step 490) that only bitstream information received up to the current time is meaningful and information after the meaningful bitstream information has been lost due to error.
In addition, if it is determined that the previous packet has not completed accumulation of packets into the bitstream when the current packet is input (step 402), that the first packet has not been lost (step 404), that an error has not occurred in the transmission of packets of the bitstream (step 406), and that a value obtained by adding one to the sequence number of the previous packet is not identical to the sequence number of the current packet (step 408), it is displayed that an error has occurred in the transmission of the bitstream (step 409), and it is reported to the upper layer through the “F” block process (step 490) that only the bitstream information received up to the current time is meaningful and information after the meaningful bitstream information has been lost due to error.
Although a depacketization operation may be performed as described above, the above-described depacketization operation cannot cope with a case in which a specific sequence numbered packet in the bitstream being accumulated has been lost. For example, when a third packet has been lost and then a fourth packet has been received, it is impossible to identify whether the received packet is the third packet or the fourth packet, so that the received fourth packet is discarded.